﻿
//Author: 张亚涛
//createtime:2011-10-13 10:31:29
//Description: 

using System;
using System.Data;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Model
{
    public class CouponsTrade
    {
        public CouponsTrade()
        { }
        public CouponsTrade(IDataReader reader)
        {
            _tradeID = long.Parse(reader["TradeID"].ToString());
            if (reader["OpenID"] != DBNull.Value)
            {
                _openID = reader["OpenID"].ToString();
            }
            if (reader["SchemeID"] != DBNull.Value)
            {
                _schemeID = int.Parse(reader["SchemeID"].ToString());
            }
            if (reader["Money"] != DBNull.Value)
            {
                _money = decimal.Parse(reader["Money"].ToString());
            }
            if (reader["Quantity"] != DBNull.Value)
            {
                _quantity = int.Parse(reader["Quantity"].ToString());
            }
            if (reader["TradeNo"] != DBNull.Value)
            {
                _tradeNo = reader["TradeNo"].ToString();
            }
            if (reader["PayNo"] != DBNull.Value)
            {
                _payNo = reader["PayNo"].ToString();
            }
            if (reader["PayDate"] != DBNull.Value)
            {
                _payDate = System.DateTime.Parse(reader["PayDate"].ToString());
            }
            if (reader["State"] != DBNull.Value)
            {
                _state = int.Parse(reader["State"].ToString());
            }
        }

        #region 数据库字段
        private long _tradeID;
        private string _openID;
        private int _schemeID;
        private decimal _money;
        private int _quantity;
        private string _tradeNo;
        private string _payNo;
        private System.DateTime _payDate;
        private int _state;
        #endregion

        #region 字段属性
        /// <summary>
        /// 订单ID
        /// </summary>
        public long TradeID
        {
            set { _tradeID = value; }
            get { return _tradeID; }
        }
        /// <summary>
        /// 用户ID
        /// </summary>
        public string OpenID
        {
            set { _openID = value; }
            get { return _openID; }
        }
        /// <summary>
        /// 洗车券套餐ID
        /// </summary>
        public int SchemeID
        {
            set { _schemeID = value; }
            get { return _schemeID; }
        }
        /// <summary>
        /// 交易金额
        /// </summary>
        public decimal Money
        {
            set { _money = value; }
            get { return _money; }
        }
        /// <summary>
        /// 购买数量
        /// </summary>
        public int Quantity
        {
            set { _quantity = value; }
            get { return _quantity; }
        }
        /// <summary>
        /// 商家单号
        /// </summary>
        public string TradeNo
        {
            set { _tradeNo = value; }
            get { return _tradeNo; }
        }
        /// <summary>
        /// 微信支付单号
        /// </summary>
        public string PayNo
        {
            set { _payNo = value; }
            get { return _payNo; }
        }
        /// <summary>
        /// 支付时间
        /// </summary>
        public System.DateTime PayDate
        {
            set { _payDate = value; }
            get { return _payDate; }
        }
        /// <summary>
        /// 状态
        /// </summary>
        public int State
        {
            set { _state = value; }
            get { return _state; }
        }
        #endregion
    }
}